<style>
p.dotted {
    border-style:dotted;
}
p.solid {
    border-style:solid;
}
</style>

<p class="solid">
<br>
<span><%= @good.name %></span>
<% if user_signed_in? %>
    <% if @good.status? %>
    <span>已售出</span>
    <% else %>
    <span><%= link_to "下单", order_good_path(@good.id) %></span>
    <% end %>
<% end %>
</br>
<br>
<span>卖家：<%= render @user %></span>
<span>价格：<%= @good.price %></span>
<span>区域：<%= @user.region %></span>
<span>成色：<%= @good.quality %></span>
</br>
</p>

<p><%= @good.description %></p>
<p><%= image_tag @good.picture.url(:medium) %></p>

<p class="dotted">
<br>评论区</br>
<% @comments.each do |comment| %>
    <br><%= comment.username %>：<%= comment.content %></br>
<% end %>
</p>

<%= form_with(model: [ @good, @good.comments.build ], local: true) do |form| %>
    <%= form.text_area :content %>
    <%= form.submit "发表评论" %>
<% end %>